package com.jeespring.order.controller;

import com.jeespring.dto.String;
import com.jeespring.order.feign.PayFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hystrix/order")
public class OrderController {

    public static final String PAY_SERVICE = "http://SPRING-CLOUD-PAY/";

    @Autowired
    private PayFeignService payFeignService;

    @GetMapping("/{id}")
    public String pay(@PathVariable Long id){
        String<Object> String = new String<>();
        String = payFeignService.pay(id);
        return String;
    }

    @GetMapping("/timeout/{id}")
    public String payTimeout(@PathVariable Long id){
        String<Object> String = new String<>();
        String = payFeignService.payTimeout(id);
        return String;
    }
}
